<%--
    Document   : interview_create
    Created on : Feb 14, 2012, 10:26:52 PM
    Author     : Admin
--%>

<%@page import="entity.Interview"%>
<%@page import="model.InterviewModel"%>
<%@page import="entity.Employee"%>
<%@page import="java.util.ArrayList"%>
<%@page import="model.EmployeeModel"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <link rel="shortcut icon" type="image/x-icon" href="./favicon.ico" />
        <link rel="stylesheet" type="text/css" href="./css/webstarter.css" media="screen" />
        <link rel="stylesheet" type="text/css" href="css/jquery-ui-1.8.17.custom.css" />
        <link rel="stylesheet" type="text/css" href="./css/superfish.css" />
        <link rel="stylesheet" type="text/css" href="./css/jquery.wysiwyg.css" />
        <link rel="stylesheet" type="text/css" href="./css/fullcalendar.css" />
        <style type="text/css">
            input[type="text"]{border: 1px solid #aaaaaa; height: 21px;}
            input[type="text"]:focus{background: #ffc;}
            input[type="password"]{border: 1px solid #aaaaaa; height: 21px;}
            input[type="password"]:focus{background: #ffc;}
        </style>

        <script type="text/javascript" src="js/jquery-1.7.1.min.js"></script>
        <script type="text/javascript" src="js/jquery-ui-1.8.17.custom.min.js"></script>
        <script type="text/javascript" src="js/additional-methods.js"></script>
        <script type="text/javascript" src="js/jquery.validate.js"></script>

        <script type="text/javascript">

            $(function() {
                $(document).ready(function(){

                    $('#scheduleDate').datepicker();

                });

                $("#insert").validate({
                    rules:{
                        scheduleDate: {
                            required:true
                        },
                        attachedDate: {
                            required:true
                        },
                        startTime: {
                            required:true
                        },
                        endTime: {
                            required:true
                        }
                    }
                })

            });

        </script>

    </head>
    <body>
        <div id="bgTop">

            <div id="core">

                <div id="bgBottom">

                    <div id="header">

                        <div id="logo">
                            <a href="./dashboard.html"><img src="./img/ws_logo.png" alt="WebStarter Dashboard" /></a>
                        </div>

                        <div id="controls">
                            <img src="./img/ws_icon_user.png" alt="User" /> Logged in: <strong>${sessionScope.name}</strong>
                        </div>

                        <div id="logOff">
                            <a href="logoffHr.do"><img src="./img/ws_logoff.png" alt="Log off" /></a>
                        </div>

                    </div><!-- END OF #header -->

                    <div id="menu">

                        <ul id="menuUl" class="sf-menu">
                            <li><span class="folder"><img src="./img/house.png" align="left" style="padding-right: 4px;" alt="Dashboard" /><a href="./viewer.jsp">Home</a></span></li>
                        </ul>
                    </div><!-- END OF #menu -->
                    <div id="content">

                        <div class="dataGrid">

                            <div id="testForm" title="Create new user" style="margin-left: 200px; margin-top: 30px;">
                                <!--  <p class="validateTips" style="width: 300px; text-align: left;">All form fields are required.</p>-->
                                <form styleId="insert" action="viewer_updateItv.do" method="post">
                                    <fieldset style="width: 400px; text-align: left;">
                                        <legend style="margin-bottom: 15px; font-size: 12px; font-weight: bolder;">Update schedule</legend>

                                        Vacancy name:<br> <input type="hidden" name="hdVacancyid" value="${it.vacancyid}"/>
                                        <input type="text" name="vacancyName" value="${it.vacancyTitle}" readonly style="width: 280px; margin-bottom: 20px; background-color: #aaaaaa"/><br>
                                        Applicant name:<br> <input type="hidden" name="hdApplicantid" value="${it.applicantid}"/>
                                        <input type="text" name="applicantName" value="${it.applicantName}" readonly style="width: 280px; margin-bottom: 20px; background-color: #aaaaaa"/><br>
                                        Employee name:<br>
                                        <select name="cbxEmployee" id="cbxEmployee">
                                            <% EmployeeModel em = new EmployeeModel();
                                                        ArrayList<Employee> lst = em.getEmpByDep(request.getParameter("did"));
                                                        InterviewModel im = new InterviewModel();
                                                        Interview lstIs = im.getInterviewByAidAndVid(request.getParameter("aid"), request.getParameter("vid"));
                                            %>
                                            <% for (int i = 0; i < lst.size(); i++) {%>
                                            <option value="<%=lst.get(i).getEmployeeId()%>" <% if (lst.get(i).getEmployeeId().equals(lstIs.getEmpid())) {
                                         out.print("selected");
                                     }%>>
                                                <%=lst.get(i).getFullname()%></option>
                                                <% }%>
                                        </select><br/><br>
                                        Schedule date:<br>
                                        <input type="text" name="scheduleDate" id="scheduleDate" value="${it.scheduleDate}" style="width: 280px; margin-bottom: 20px;"/><br>
                                        Attached date:<br>
                                        <input type="text" name="attachedDate" readonly value="${it.attachedDate}" style="width: 280px; margin-bottom: 20px;"/><br>
                                        Start time:<br>
                                        <input type="text" name="startTime" value="${it.startTime}" style="width: 280px; margin-bottom: 20px;"/><br>
                                        End time:<br>
                                        <input type="text" name="endTime" value="${it.endTime}" style="width: 280px; margin-bottom: 20px;"/><br>
                                        Command:<br>
                                        <input type="text" name="command" value="${it.command}" style="width: 280px; margin-bottom: 20px;"/><br>
                                        Status:<br>
                                        <select name="cbxStatus">
                                            <option value="${it.status}">${it.status}</option>
                                            <option value="Scheduled">Scheduled</option>
                                            <option value="Selected">Selected</option>
                                            <option value="Rejected">Rejected</option>
                                            <option value="Not Required">Not Required</option>
                                        </select><br><br>

                                        <input type="submit" value="Update" />
                                        <input type="reset" value="Reset" />
                                    </fieldset>

                                </form>
                            </div>

                        </div>

                    </div><!-- END OF #content -->
                    <div id="footer">
                        <strong>Recruitment Content Management System</strong> - 2011 &copy; worldup.com
                    </div>

                </div><!-- END OF #bgBottom -->

            </div><!-- END OF #core -->

        </div><!-- END OF #bgTop -->
    </body>
</html>
